<?php

declare (strict_types=1);

namespace App\Model;

use Hyperf\Database\Model\Collection;
use Hyperf\DbConnection\Model\Model;

/**
 * @property int cooperative_id
 * @property string name
 * @property \Hyperf\Utils\HigherOrderTapProxy|mixed|void|null id
 * @property-read Collection cooperativeMenus
 */
class CooperativeRole extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'cooperative_role';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['name','remark'];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [];


    public function cooperativeMenus()
    {
        return $this->belongsToMany(CooperativeMenu::class,'cooperative_role_menu','role_id','menu_id');
    }

}